package com.example.demo.controller;

import com.example.demo.entity.UserEntity;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2023-05-06
 * Time: 17:09
 */
@RequestMapping("/user")
@RestController // 访问 service 里的对象
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/getall")
    public List<UserEntity> getAll() {
        return userService.getAll();
    }
}
